Skip to content

Fixed the bots spinning back to their starting heading when going to home#263

Merged
MahdMalik merged 8 commits intomainfrom
Fixed-AI-crashing-bots-together
Feb 21, 2026
Merged

Fixed the bots spinning back to their starting heading when going to home#263
MahdMalik merged 8 commits intomainfrom
Fixed-AI-crashing-bots-together

Conversation

@Krish54491
Copy link
Contributor

I just added a boolean in some methods to differentiate between captured and uncaptured pieces, haven't seen any issue pop up because of it

@Kandles11 Kandles11 requested a review from Copilot September 30, 2025 00:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes robot behavior when returning home after capturing a piece by preventing them from spinning back to their starting heading. The fix introduces a noReverse parameter that disables the reversal of setup commands for captured pieces.

  • Added a noReverse boolean parameter to prevent robots from spinning back to starting positions
  • Fixed import statement and error handling by replacing error with proper Error constructor
  • Refactored AI move timing to wait for robot movements before sending move messages

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/server/robot/path-materializer.ts Added noReverse parameter and fixed import/error handling
src/server/command/move-piece.ts Modified command reversal logic based on noReverse flag
src/server/api/game-manager.ts Changed AI move timing to wait for robot completion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 23 to 24
(command) =>
!noReverse ? command.reverse() : command,
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When noReverse is true, the setup commands are not reversed but still added to the command group. This means the robots will execute the same setup commands twice (once in setup, once in 'cleanup'), which could cause incorrect positioning.

Copilot uses AI. Check for mistakes.
@MahdMalik MahdMalik self-requested a review February 21, 2026 01:51
Copy link
Contributor

@MahdMalik MahdMalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it looks good, surely nothing will break

@MahdMalik MahdMalik merged commit 6aa320a into main Feb 21, 2026
5 checks passed
@MahdMalik MahdMalik deleted the Fixed-AI-crashing-bots-together branch February 21, 2026 01:54
@Krish54491
Copy link
Contributor Author

Krish54491 commented Feb 23, 2026 via email

@MahdMalik
Copy link
Contributor

It'll break everything don't do it!

On Fri, Feb 20, 2026 at 7:54 PM MahdMalik @.> wrote: @.* approved this pull request. i think it looks good, surely nothing will break — Reply to this email directly, view it on GitHub <#263 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3LV7X4WC6Z74X3KYIOX2O34M63ETAVCNFSM6AAAAACH2O4JKOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTQMZUHAYDAMZZGY . You are receiving this because you authored the thread.Message ID: @.***>

wait actually? 😭 so far it's been fine

@Krish54491
Copy link
Contributor Author

Krish54491 commented Feb 23, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants